import request from '@/axios'
import { RuleType } from './types'

export const getRuleListApi = (params: any) => {
  return request.get<RuleType[]>({ url: '/dispatch/rule', params })
}

export const addRuleApi = (data: any) => {
  return request.post({ url: '/dispatch/rule', data })
}

export const putRuleApi = (data: any) => {
  return request.put({ url: `/dispatch/rule/${data.id}`, data })
}

export const deleteRuleApi = (ids: string[] | number[]) => {
  return request.delete({ url: '/dispatch/rule', data: ids })
}
